<% @cookbooks = Cookbook.find_all_by_user_id(session[:user_id], :order => "title").map {|c| [c.title, c.id]} %>
<% @new_cookbook_recipe = CookbookRecipe.new %>
<% @new_cookbook_recipe.recipe_id = add_to_cookbook_form[:recipe_id] %>
<% if @cookbooks.empty? %>
<%= link_to "Create a Cookbook", :controller =>"cookbooks", :action=>"new", :id=>@recipe %>
<% else %>
Add to cookbook form
<% remote_form_for @new_cookbook_recipe, :url => {:action => "create_cookbook_recipe" } do |f| %>
  <%= f.select(:cookbook_id, @cookbooks) %>
  <%= f.hidden_field :recipe_id %>
  <%= f.submit "Add to cookbook" %>
<%  end %>
<%  end %>
